<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="com.tisson.pojo.Page"%>
<%@ page import="com.tisson.pojo.Admin"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <script type="text/javascript">
function checkAll(name) {
	var el = document.getElementsByTagName('input');
	var len = el.length;
	for(var i=0; i<len; i++){
		if((el[i].type=="checkbox") && (el[i].name==name)){
			el[i].checked = true;
		}
	}
}
function clearAll(name){
	var el = document.getElementsByTagName('input');
	var len = el.length;
	for(var i=0; i<len; i++){
		if((el[i].type=="checkbox") && (el[i].name==name)){
			el[i].checked = false;
		}
	}
} 
function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g,"");
}
function form_submit(){
	document.getElementById("form").submit();
}
function goto(){
	var arg = document.getElementById("page_goto").value;
	if(!checkIsInteger(arg)){
		arg = 1;
	}
	var url = "Page_changePage.action?requestPage="+arg+"&map=JspCmDepartmentList";
	window.navigate(url);
}
function checkIsInteger(str)   {    
    if(/^(\-?)(\d+)$/.test(str))   
        return true;   
    else  
        return false;   
}
</script>
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<style type="text/css">
	img{
	 border: 0;
	}
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
a{
	font-size: 12px;
	color: #3b6375;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
.submitStyle {background:url(images/del.gif);border:0px} 
</style>
  </head>
<body>
<form name="searchForm" action="Dept_search" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1">搜索</span></td>
              </tr>
            </table></td>
            <td>
            	<div align="right">
            		<span class="STYLE1">
              			<input type="image" src="images/search.jpg" onClick="searchForm.submit()"/>
              		</span>
              		<span class="STYLE1">
              			&nbsp;
              		</span>
              	</div>
            </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
      <tr>
        <td width="21%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门名称</span></div></td>
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10"></span></div></td>
        <td width="21%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门主管</span></div></td>
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10"></span></div></td>
        <td width="21%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门地址</span></div></td>
        <td width="5%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10"></span></div></td>
        <td width="21%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门联系电话</span></div></td>
      </tr>
      <tr>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<input type="text" name="depName"/>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<select name="logicMark0">
        		<option value="AND">与</option>
        		<option value="OR">或</option>
        	</select>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<input type="text" name="depAdmin"/>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<select name="logicMark1">
        		<option value="AND">与</option>
        		<option value="OR">或</option>
        	</select>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<input type="text" name="depAddress"/>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<select name="logicMark2">
        		<option value="AND">与</option>
        		<option value="OR">或</option>
        	</select>
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">
        	<input type="text" name="depPhone"/>
        </div></td>    
      </tr>
    </table></td>
  </tr>
</table>
</form>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 部门信息列表</span></td>
              </tr>
            </table></td>
            <td>
            	<div align="right">
            		<span class="STYLE1">
            		<%if(((Admin)request.getSession().getAttribute("admin")).getRole().equals("中心管理员")){ %>
              			<input type="checkbox" name="checkbox" value="" onclick="if(this.checked==true) { checkAll('id'); } else { clearAll('id'); }" />全选&nbsp;&nbsp;
              			<input type="image" src="images/add.gif" onClick="location.href='/mj/jsp/cm/department/add.jsp'"/> 添加&nbsp;&nbsp;
              			<input type="image" src="images/del.gif" id="_delete" name="method:delete" onClick="form_submit()" /> 删除&nbsp;&nbsp;
              		<%} %>
              		</span>
              		<span class="STYLE1">
              			&nbsp;
              		</span>
              	</div>
            </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
      <tr>
      <%if(((Admin)request.getSession().getAttribute("admin")).getRole().equals("中心管理员")){ %>
        <td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div align="center">
          <input type="checkbox" name="checkbox" value="" onclick="if(this.checked==true) { checkAll('id'); } else { clearAll('id'); }" />
        </div></td>
        <%} %>
        <td width="28%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门名称</span></div></td>
        <td width="7%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门主管</span></div></td>
        <td width="35%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门地址</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">部门联系电话</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      </tr>
      <form name="form" action="Dept_delete" method="post">
      <s:iterator value="result" status="status">
      <tr>
      <%if(((Admin)request.getSession().getAttribute("admin")).getRole().equals("中心管理员")){ %>
        <td height="20" bgcolor="#FFFFFF"><div align="center">
          <input type="checkbox" name="id" value="<s:property value="departmentId"/>"/>
        </div></td>
        <%} %>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><s:property value="depName"/></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><s:property value="depAdmin"/></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><s:property value="depAddress"/></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><s:property value="depPhone"/></div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><%if(((Admin)request.getSession().getAttribute("admin")).getRole().equals("中心管理员")){ %><a href="Dept_delete.action?id=<s:property value="departmentId"/>">删除</a> | <%} %><a href="Dept_edit.action?id=<s:property value="departmentId"/>">编辑</a></div></td>
      </tr>
      </s:iterator>
     </form>
    </table></td>
  </tr>
	<tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="33%"><div align="left"><span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong><s:property value="page.listSize"/></strong> 条记录，当前第<strong><s:property value="page.currentPage"/></strong> 页，共 <strong><s:property value="page.totalPages"/></strong> 页</span></div></td>
        <td width="67%"><table width="312" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="49"><div align="center"><a href="Page_changePage.action?requestPage=1&map=JspCmDepartmentList"><img src="images/main_54.gif" width="40" height="15" /></a></div></td>
            <td width="49"><div align="center"><a href="Page_changePage.action?requestPage=<s:property value="page.prePage"/>&map=JspCmDepartmentList"><img src="images/main_56.gif" width="40" height="15" /></a></div></td>
            <td width="49"><div align="center"><a href="Page_changePage.action?requestPage=<s:property value="page.nextPage"/>&map=JspCmDepartmentList"><img src="images/main_58.gif" width="40" height="15" /></a></div></td>
            <td width="49"><div align="center"><a href="Page_changePage.action?requestPage=<s:property value="page.totalPages"/>&map=JspCmDepartmentList"><img src="images/main_60.gif" width="40" height="15" /></a></div></td>
            <td width="37" class="STYLE22"><div align="center">转到</div></td>
            <td width="22"><div align="center">
              <input type="text" name="textfield" id="page_goto"  style="width:20px; height:12px; font-size:12px; border:solid 1px #7aaebd;"/>
            </div></td>
            <td width="22" class="STYLE22"><div align="center">页</div></td>
            <td width="35"><img src="images/main_62.gif" width="26" height="15" onClick="goto()"/></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
